﻿@model HanGu.Entity.MemberInfo
@{
    Layout = null;
    TempData["TitlePic"] = Model.PicPath;//.Replace("_B.", "_S.");
    TempData["ContorlID"] = "Introduction";
    TempData["Remark"] = Model.Introduction;
    TempData["GropName"] = Model.GUID;
    var SexList = ViewData["SexList"] as SelectList;
    var IsMarryList = ViewData["IsMarry"] as SelectList;
    var ProviceList = ViewData["Provice"] as SelectList;
    var CityList = ViewData["City"] as SelectList;
    var NativePlaceList = ViewData["NativePlace"] as SelectList;
    var JobList = ViewData["Job"] as SelectList;
    var TradeList = ViewData["Trade"] as SelectList;
    var InterestList = ViewData["Interest"] as SelectList;
    List<string> InterestArry = new List<string>();
    if (Model.Interest != null)
    { InterestArry.AddRange(Model.Interest.Split(',')); }
    var MemberGrade = ViewData["MemberGrade"] as SelectList;
    var Degree = ViewData["Degree"] as SelectList;


    var ChangeCharges = ViewData["ChangeCharge"] as List<HanGu.Entity.VChangeChargeRecorde>;//充值积分
    var ChangeGrades = ViewData["ChangeGrade"] as List<HanGu.Entity.VChangeGradeRecorde>;//学位变更
    var ChargeProducts = ViewData["ChargeProduct"] as List<HanGu.Entity.VChargeRecorde>;//兑换产品

    
}
<script>
        function SelectJobOther(value,obj) {            
            if (value.indexOf("9999") > 0)
            {  $("#@ViewData["CurrentController"]Form #"+obj).show();}
            else
            { $("#@ViewData["CurrentController"]Form #"+obj).hide(); }
        }        
        $(document).ready(function(){
        SelectJobOther("","JobOther");
        SelectJobOther("","TradeOther");
        $("#@ViewData["CurrentController"]Form #Degree").val("@Model.Degree");
        $("#@ViewData["CurrentController"]Form #Grade").val("@Model.Grade");
        $("#@ViewData["CurrentController"]Form #Sex").val("@Model.Sex");
        $("#@ViewData["CurrentController"]Form #IsMarry").val("@Model.IsMarry");
        $("#@ViewData["CurrentController"]Form #Provice").val("@Model.Provice");
        $("#@ViewData["CurrentController"]Form #City").val("@Model.City");
        $("#@ViewData["CurrentController"]Form #NativePlace").val("@Model.NativePlace");
        $("#@ViewData["CurrentController"]Form #Job").val("@Model.Job");
        $("#@ViewData["CurrentController"]Form #Trade").val("@Model.Trade");
        });   
</script>
<div class="pageContent">
    <form method="get" onsubmit="return navTabSearch(this);" id="@ViewData["CurrentController"]Form" action="admin/@ViewData["CurrentController"]/Detail/@Model.ID" >
    @Html.ValidationSummary(true)
    <div class="pageFormContent" layouth="56">
        @Html.HiddenFor(model => model.ID)
        @Html.HiddenFor(model => model.GUID)
        @Html.HiddenFor(model => model.Pwd)
        <div class="CreateDiv">
            <div class="LeftDiv">
                <div>
                    <label>
                        标题图片：</label>
                    <img id="preview" src="@Model.PicPath"/>

                </div>
                <p>
                    <label>
                        积分：</label>
                    @Model.Charge
                </p>
                <p>
                    <label>
                        创建时间：</label>
                    @Model.CreateTime
                </p>
                <p>
                    <label>
                        创建者：</label>
                    @Model.Creator
                </p>
                <p>
                    <label>
                        修改时间：</label>
                    @Model.UpdateTime
                </p>
                <p>
                    <label>
                        修改者：</label>
                    @Model.Updater
                </p>
                <p>
                    <label>
                        是否接收短信：</label>
                    @Html.CheckBox("NoSMS", Model.NoSMS.Value, new { disabled = "disabled" })
                </p>
                <p>
                    <label>
                        是否接收邮件：</label>
                    @Html.CheckBox("NoEmail", Model.NoEmail.Value, new { disabled = "disabled" })
                </p>
            </div>
            <div class="rightDiv">
                <p>
                    <label>
                        真实姓名：</label>
                    @Model.RealName
                </p>
                <p>
                    <label>
                        学位：</label>
                    @{
                        var modelDegree = Degree.SingleOrDefault(c => c.Value == Model.Degree);
                        if (modelDegree != null)
                        {
                        @modelDegree.Text
                        }                                  }
                </p>
                <p>
                    <label>
                        级别：</label>
                    @{
                        var modelGrade = MemberGrade.SingleOrDefault(c => c.Value == Model.Grade);
                        if (modelGrade != null)
                        { 
                        @modelGrade.Text;
                        }
                    }
                </p>
                @* <p>
                            <label>
                                账号：</label>
                            @Model.UserName
                        </p>*@
                <p>
                    <label>
                        性别：</label>
                    @{
                        var sexModel = SexList.SingleOrDefault(c => c.Value == Model.Sex);
                        if (sexModel != null)
                        {
                        @sexModel.Text
                        }
                    }
                </p>
                <p>
                    <label>
                        婚姻状况：</label>
                    @{
                        var marryModel = IsMarryList.SingleOrDefault(c => c.Value == Model.IsMarry);
                        if (marryModel != null)
                        {
                        @marryModel.Text
                        }
                    }
                </p>
                <p>
                    <label>
                        手机：</label>
                    @Model.Tel
                </p>
                <p>
                    <label>
                        邮箱：</label>
                    @Model.Email
                </p>
                <p>
                    <label>
                        证件号码：</label>
                    @Model.CredentialNum
                </p>
                <p>
                    <label>
                        所在城市：</label>
                    @{
                        var modelProvice = ProviceList.SingleOrDefault(c => c.Value == Model.Provice);
                        if (modelProvice != null)
                        {
                        @modelProvice.Text
                        }
                                
                    }
                    &nbsp;&nbsp;
                    @{
                        var modelCity = CityList.SingleOrDefault(c => c.Value == Model.City);
                        if (modelCity != null)
                        {
                        @modelCity.Text
                        }
                    }
                </p>
                <p>
                    <label>
                        通讯地址：</label>
                    @Model.Address
                </p>
                <p>
                    <label>
                        邮编：</label>
                    @Model.Zip
                </p>
                <p>
                    <label>
                        籍贯：</label>
                    @{
                        var modelNativePlace = NativePlaceList.SingleOrDefault(c => c.Value == Model.NativePlace);
                        if (modelNativePlace != null)
                        {
                        @modelNativePlace.Text
                        }
                    }
                </p>
                <p style="width: 500px">
                    <label>
                        职业：</label>
                    @if (!string.IsNullOrEmpty(Model.Job))
                    {
                        @Model.JobOther
                    }
                    else
                    {

                        var jobModel = JobList.SingleOrDefault(c => c.Value == Model.Job);
                        if (jobModel != null)
                        {
                        @jobModel.Text;
                        }
                    }
                </p>
                <p>
                    <label>
                        工作单位：</label>
                    @Model.WorkAddress
                </p>
                <p style="width: 500px">
                    <label>
                        所属行业：</label>
                    @if (!string.IsNullOrEmpty(Model.TradeOther))
                    {
                        @Model.TradeOther
                    }
                    else
                    {
                        var tradeModel = TradeList.SingleOrDefault(c => c.Value == Model.Trade);
                        if (tradeModel != null)
                        {
                        @tradeModel.Text
                        }
                    }
                </p>
                <p>
                    <label>
                        职位：</label>
                    @Model.Position
                </p>
                <p>
                    <label>
                        兴趣点：</label>
                    @foreach (var item in InterestList)
                    {
                        if (InterestArry.Contains(item.Value))
                        {
                        @item.Text
                        }
                    }
                </p>
            </div>
        </div>
        <div>
            <p style="width: 100%;">
                <label>
                    简介：</label>
                @Model.Introduction
            </p>
        </div>
        <div>
            <label>
                充值积分记录：</label>
            <div>
                <table class="list" width="400px" style="clear: both; padding-left: 100px;">
                <tbody>
                    @foreach (var item in ChangeCharges)
                    {
                        <tr>
                            <td>
                            </td>
                            <td>
                                <span formatdate="yyyy年MM月dd日 hh时mm分">@item.ChangeTime</span>
                            </td>
                            <td style="padding-left: 5px; padding-right: 5px">
                                <span>购买积分</span>
                            </td>
                            <td style="text-align: right;">@item.ChangeValue.ToString("D")
                            </td>
                            <td>
                                &nbsp;<img src="/Content/images/money.png" />
                            </td>
                        </tr>
                    }
                    </tbody>
                </table>
            </div>
        </div>
        <div>
            <label>
                兑换积分记录：</label>
            <table class="list" width="400px" style="clear: both; padding-left: 100px;">
                @foreach (var item in ChargeProducts)
                {
                    <tr>
                        <td>
                        </td>
                        <td>
                            <span formatdate="yyyy年MM月dd日 hh时mm分">@item.ChangeTime</span>
                        </td>
                        <td style="padding-left: 5px; padding-right: 5px">
                            <span>兑换积分</span>
                        </td>
                        <td style="text-align: right;">@item.ChangeValue.ToString("D")
                        </td>
                        <td>
                            &nbsp;<img src="/Content/images/money.png" />
                        </td>
                    </tr>
                }
            </table>
        </div>
        <div>
            <div>
                <label>
                    学位记录：</label>
                <table class="list" width="400px" style="clear: both; padding-left: 100px;">
                    @foreach (var item in ChangeGrades)
                    {
                        <tr>
                            <td>
                            </td>
                            <td>
                                <span formatdate="yyyy年MM月dd日 hh时mm分">@item.ChangeTime</span>
                            </td>
                            <td style="padding-left: 5px; padding-right: 5px">
                                <span>@item.ChangeReason</span>
                            </td>
                            <td>
                                成为 @Degree.SingleOrDefault(c => c.Value == item.ChangeValue).Text
                            </td>
                            <td>
                            </td>
                        </tr>
                    }
                </table>
            </div>
        </div>
    </div>
    <div class="formBar">
        <ul>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="submit">
                            编辑</button></div>
                </div>
            </li>
            <li>
                <div class="button">
                    <div class="buttonContent">
                        <button type="button" class="close">
                            取消</button></div>
                </div>
            </li>
        </ul>
    </div>
    </form>
</div>
